﻿@using NewLife.Common;
@using NewLife.Cube
@{
    var set = NewLife.Cube.Setting.Current;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="新生命团队,NewLife,魔方,Cube,XCode,Yooyeah,XIoT" />
    @*上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！*@
    <title>@ViewBag.Title - @SysConfig.Current.DisplayName</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon">

    <!-- 网页字体 -->
    <script src="https://cdn.bootcss.com/webfont/1.6.16/webfontloader.js"></script>
    <script>
        WebFont.load({
            google: { "families": ["Poppins:300,400,500,600,700", "Roboto:300,400,500,600,700"] },
            active: function () {
                sessionStorage.fonts = true;
            }
        });
    </script>
    <!-- 强制页面样式 -->
    <link href="~/assets/vendors/general/perfect-scrollbar/css/perfect-scrollbar.css" rel="stylesheet" type="text/css" />

    <!-- 核心页面样式 -->
    <link href="~/Assets/vendors/general/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/bootstrap-timepicker/css/bootstrap-timepicker.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/bootstrap-datetime-picker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
    <link href="~/assets/vendors/general/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/animate.css/animate.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/bootstrap-select/dist/css/bootstrap-select.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/select2/dist/css/select2.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/general/sweetalert2/dist/sweetalert2.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/custom/vendors/fontawesome5/css/all.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/custom/vendors/flaticon/flaticon.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/vendors/custom/vendors/line-awesome/css/line-awesome.css" rel="stylesheet" type="text/css" />
    <link href="~/assets/app/custom/wizard/wizard-v2.default.css" rel="stylesheet" type="text/css" />

    <!-- 全局皮肤样式 -->
    <link href="~/Assets/theme/default/base/style.bundle.min.css" rel="stylesheet" type="text/css" />
    <link href="~/assets/theme/default/skins/header/base/light.min.css" rel="stylesheet" type="text/css" />
    <link href="~/assets/theme/default/skins/header/menu/light.min.css" rel="stylesheet" type="text/css" />
    <link href="~/assets/theme/default/skins/brand/dark.min.css" rel="stylesheet" type="text/css" />
    <link href="~/assets/theme/default/skins/aside/dark.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Assets/app/custom/cube.styles.css" rel="stylesheet" type="text/css" /> <!-- 自定义样式 -->

    <!--jquery必须放前面才可以使用多选 sk-->
    <script src="~/assets/vendors/general/jquery/dist/jquery.js" type="text/javascript"></script>
</head>
<body class="kt-subheader--fixed kt-subheader--enabled kt-subheader--solid">
    <div class="kt-grid__item kt-grid__item--fluid kt-grid kt-grid--hor">
        @Html.Partial("_Layout_Breadcrumbs")
        <div class="kt-content kt-grid__item kt-grid__item--fluid" style="display: flex; flex-direction: column;" id="kt_content">
            @RenderBody()

            @if (DbRunTimeModule.Enable)
            {
                <div class="kt-padding-0">
                    <div class="alert alert-secondary" role="alert">
                        <div class="alert-text">
                            @Html.Raw(DbRunTimeModule.GetInfo())
                        </div>
                    </div>
                </div>
            }
        </div>
    </div>
    <div id="kt_scrolltop" class="kt-scrolltop">
        <i class="fa fa-arrow-up"></i>
    </div>

    <!-- 核心脚本资源 -->
    <script src="~/Assets/vendors/general/popper.js/dist/umd/popper.min.js"></script>
    <script src="~/assets/vendors/general/block-ui/jquery.blockUI.js"></script>
    <script src="~/Assets/vendors/general/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="~/Assets/vendors/general/tooltip.js/dist/umd/tooltip.js"></script>
    <script src="~/Assets/vendors/general/perfect-scrollbar/dist/perfect-scrollbar.js"></script>
    <script src="~/assets/vendors/general/sticky-js/dist/sticky.min.js"></script>
    <script src="~/Assets/vendors/general/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <script src="~/Assets/vendors/general/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
    <script src="~/Assets/vendors/general/bootstrap-datetime-picker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="~/assets/vendors/general/bootstrap-daterangepicker/moment.min.js"></script>
    <script src="~/assets/vendors/general/bootstrap-daterangepicker/daterangepicker.js"></script>
    <script src="~/Assets/vendors/general/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
    <script src="~/Assets/vendors/general/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
    <script src="~/Assets/vendors/general/select2/dist/js/select2.full.min.js"></script>
    <script src="~/Assets/vendors/general/sweetalert2/dist/sweetalert2.all.min.js"></script>
    <script src="~/assets/vendors/general/jquery-validation/dist/jquery.validate.js" type="text/javascript"></script>
    <script src="~/assets/vendors/general/jquery-validation/dist/additional-methods.js" type="text/javascript"></script>
    <!-- 可选脚本资源 -->
    <script src="~/Assets/vendors/general/jquery.repeater/src/lib.js"></script>
    <script src="~/Assets/vendors/general/jquery.repeater/src/jquery.input.js"></script>
    <script src="~/Assets/vendors/general/jquery.repeater/src/repeater.js"></script>
    <!-- 全局脚本资源 -->
    <script src="~/Assets/theme/default/base/scripts.bundle.min.js"></script>
    <script src="~/assets/vendors/custom/datatables/datatables.bundle.min.js"></script>
    <script src="~/assets/vendors/general/perfect-scrollbar/dist/perfect-scrollbar.min.js"></script>

    <!-- 模板自定义脚本资源 -->
    <script src="~/assets/app/custom/cube.app.bundle.js"></script>

    @RenderSection("scripts", required: false)

    <!--日历控件支持-->
    <script>
        $(function () {
            $('.form_datetime').each(function () {
                var df = $(this).attr('dateformat');
                if (!df) {
                    $(this).attr('dateformat', 'yyyy-mm-dd hh:ii:ss');
                    //$(this).width(140);
                }
                else {
                    // 把C#标准格式化替换为控件格式
                    df = df.replace('mm', 'ii').replace('MM', 'mm').replace('HH', 'hh');
                    $(this).attr('dateformat', df);

                    // 根据时间日期格式，锁定日期输入框宽度
                    //if (df.indexOf('hh') >= 0)
                    //    $(this).width(140);
                    //else
                    //    $(this).width(80);
                }

                //根据日期格式自动推算日期选择view显示的范围
                var sv = 2;
                var mv = 2;
                var autoView = $(this).attr('autoView');
                if (autoView !== 'false') {
                    df = $(this).attr('dateformat');
                    if (df.indexOf('ii') >= 0) {
                        mv = 0;
                        if (df.indexOf('dd') >= 0) {
                            sv = 2;
                        } else {
                            sv = 1;
                        }
                    } else if (df.indexOf('hh') >= 0) {
                        mv = 1;
                        if (df.indexOf('dd') >= 0) {
                            sv = 2;
                        } else {
                            sv = 1;
                        }
                    } else if (df.indexOf('dd') >= 0) {
                        mv = 2;
                        sv = 2;
                    } else if (df.indexOf('mm') >= 0) {
                        mv = 3;
                        sv = 3;
                    } else if (df.indexOf('yyyy') >= 0) {
                        mv = 4;
                        sv = 4;
                    }
                }

                $(this).attr('startview', sv);
                $(this).attr('minview', mv);
            });
            $("[dateformat]").each(function () {
                $(this).datetimepicker({
                    format: $(this).attr("dateformat"),
                    autoclose: true,
                    language: "zh-CN",
                    forceParse: false,
                    startView: parseInt($(this).attr('startview')),
                    minView: parseInt($(this).attr('minview'))
                });
            });
           
            //$('.multiselect').each(function () {
            //    $(this).multiselect({
            //        // 下拉列表仅在列表项比较多时显示过滤框
            //        enableFiltering: $(this).children().length > 10,
            //        buttonClass: 'btn btn-white btn-primary',
            //        templates: {
            //            button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>',
            //            ul: '<ul class="multiselect-container dropdown-menu"></ul>',
            //            filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="fa fa-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>',
            //            filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default btn-white btn-grey multiselect-clear-filter" type="button"><i class="fa fa-times-circle red2"></i></button></span>',
            //            li: '<li><a href="javascript:void(0);"><label></label></a></li>',
            //            divider: '<li class="multiselect-item divider"></li>',
            //            liGroup: '<li class="multiselect-item group"><label class="multiselect-group"></label></li>'
            //        },
            //        filterPlaceholder: '搜索',
            //        nonSelectedText: '无',
            //        allSelectedText: '全选'
            //    });
            //});
           
            @*双击跳转到form
            _List_Data_Action.cshtml变更
            @Html.ActionLink("编辑", "Edit", new { id = @Model },new{@class="editcell"})*@
            $('tr').dblclick(function () {
                var $this = $(this);
                var row = $this.closest("tr");
                var findcell = row.find('.editcell');
                if (findcell.length > 0) window.location.href = findcell.attr("href");
            });
        });
    </script>

    <!--开关插件-->
    <script src="~/Assets/vendors/general/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
    <script>
        $(function () {
            $("input.chkSwitch").bootstrapSwitch();

            //区间时间插件
            $("input[name='dtRange']").daterangepicker(
                {
                    // autoApply: true,
                    // autoUpdateInput: false,
                    // alwaysShowCalendars: true,
                    buttonClasses: 'btn',
                    applyClass: 'btn-primary',
                    cancelClass: 'btn-secondary',
                    ranges: {
                        '今天': [moment(), moment()],
                        '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                        '近7天': [moment().subtract(7, 'days'), moment()],
                        '近30天': [moment().subtract(29, 'days'), moment()],
                        '这个月': [moment().startOf('month'), moment().endOf('month')],
                        '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                    },
                    locale: {
                        format: "YYYY/MM/DD HH:mm:SS",
                        separator: " - ",
                        applyLabel: "确认",
                        cancelLabel: "清空",
                        fromLabel: "开始时间",
                        toLabel: "结束时间",
                        customRangeLabel: "自定义日期范围",
                        daysOfWeek: ["日", "一", "二", "三", "四", "五", "六"],
                        monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
                    }
                }
            ).on('cancel.daterangepicker', function (ev, picker) {
                $("#dtRange").val("请选择日期范围");
                $("#dtStart").val("");
                $("#dtEnd").val("");
            }).on('apply.daterangepicker', function (ev, picker) {
                $("#dtStart").val(picker.startDate.format('YYYY-MM-DD'));
                $("#dtEnd").val(picker.endDate.format('YYYY-MM-DD'));
                $("#dtRange").val(picker.startDate.format('YYYY-MM-DD') + " 至 " + picker.endDate.format('YYYY-MM-DD'));
            });
        });
    </script>
    <script>
        var KTAppOptions = {
            "colors": {
                "state": {
                    "brand": "#5d78ff",
                    "dark": "#282a3c",
                    "light": "#ffffff",
                    "primary": "#5867dd",
                    "success": "#34bfa3",
                    "info": "#36a3f7",
                    "warning": "#ffb822",
                    "danger": "#fd3995"
                },
                "base": {
                    "label": ["#c5cbe3", "#a1a8c3", "#3d4465", "#3e4466"],
                    "shape": ["#f0f3ff", "#d9dffa", "#afb4d4", "#646c9a"]
                }
            }
        };
    </script>

    @*artDialog*@
    @*<script src="~/artDialog/dist/dialog-plus-min.js"></script>
        <script src="~/artDialog/dist/dialog.new.life.js"></script>*@
    @*模态窗Ajax删除提示*@
    @*<script src="~/Cube.js?v=2.0.2017.1126"></script>*@
</body>
</html>
